import { createRouter, createWebHistory } from "vue-router";

import Layout from "@/views/layout/index.vue";
import LoginPage from "@/views/login/index.vue";
import IndexPage from "@/views/index/index.vue";
import ClazzPage from "@/views/clazz/index.vue";
import StuPage from "@/views/stu/index.vue";
import DeptPage from "@/views/dept/index.vue";
import EmpPage from "@/views/emp/index.vue";
import EmpReportPage from "@/views/report/emp/index.vue";
import StuReportPage from "@/views/report/stu/index.vue";
import LogPage from "@/views/log/index.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: Layout,
      redirect: "/index",
      children: [
        { path: "index", component: IndexPage },
        { path: "clazz", component: ClazzPage },
        { path: "stu", component: StuPage },
        { path: "dept", component: DeptPage },
        { path: "emp", component: EmpPage },
        { path: "empReport", component: EmpReportPage },
        { path: "stuReport", component: StuReportPage },
        { path: "log", component: LogPage },
      ],
    },
    {
      path: "/login",
      name: "Login",
      component: LoginPage,
    },
  ],
});

export default router;
